import react,{Component} from "react";

export default class SendScreen extends Component {
    handleSendClick=(text)=>{
        return ()=>{
            // alert(text.value)
            // alert(typeof text.value)
            this.props.sendMessage(text.value)
        }
    }
    render() {
        let text=document.getElementById("text-message")
        // let newtext=text.value;
        return(
            <form style={{backgroundColor:"blue"}} >
                <input type="text" id="text-message" name="text-message" placeholder="have a chatting!" />
                <button onClick={this.handleSendClick(text)} >发送</button>
            </form>
            )
    }
}